<template>
	<view class="task-wrap">
		<!-- 代办 -->
		<view v-if="todo">
			<u-navbar :is-back="false" title="代办"></u-navbar>
			<todo></todo>
		</view>
		<!-- 仪器领用申请 -->
		<view v-if="collection">
			<u-navbar :is-back="false" title="仪器领用申请"></u-navbar>
			<collection></collection>
		</view>
		<tabBar></tabBar>
	</view>

</template>

<script>
	import todo from './todo/index.vue'
	import collection from './collection/index.vue'
	export default {
		components: {
			todo,
			collection
		},
		data() {
			return {
				todo: false,
				collection: false,
				id: ''
			}
		},
		// onLoad(option) {
		// 	console.log(option)
		// 	this.id = option.id
		// 	if (option.todo == 0) {
		// 		this.todo = true
		// 		this.collection = false
		// 	}
		// 	if (option.collection == 1) {
		// 		this.todo = false
		// 		this.collection = true
		// 	}
		// },
		mounted() {
			this.query()
		},
		methods: {
			query() {
				//获取本地存储信息
				var data = wx.getStorageSync('todo')
				console.log(data)
				if (data == 0) {
					this.todo = true
					this.collection = false
				} else if (data == 1) {
					this.todo = false
					this.collection = true
				}
			}
		}
	}
</script>

<style>
</style>